Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 8, 2025

Fixes #506

Added an explicit glob pattern *requirements*.txt to ensure requirements files at the workspace root are reliably found. The fix includes:

  1. Additional search pattern: Added findFiles('*requirements*.txt') to explicitly search the workspace root
  2. Deduplication logic: Implemented deduplication using a Map keyed by file system path to handle overlapping patterns
  3. Comprehensive tests: Created 5 new unit tests to validate the fix

Now both patterns work together:

  • **/*requirements*.txt - finds requirements files in subdirectories
  • *requirements*.txt - finds requirements files at workspace root

Requirements Files Now Discovered

This fix ensures all common requirements file naming patterns are found:

  • requirements.txt - main dependencies
  • dev-requirements.txt - development dependencies ✨
  • test-requirements.txt - testing dependencies ✨
  • docs-requirements.txt - documentation dependencies ✨
  • prod-requirements.txt - production dependencies ✨
  • Any other *requirements*.txt variant ✨
Original prompt

This section details on the original issue you should resolve

<issue_title>Missing requirements file in workspace dependencies list</issue_title>
<issue_description>I have the following file structure

Image

  • click + on venv in environments panel
  • click to create environment in root directory
  • custom environment
  • install workspace dependencies
  • I only see requirements.txt as an option

I expect I would see both dev-requirements.txt and requirements.txt because they are both present in the root folder

Image

</issue_description>

Comments on the Issue (you are @copilot in this section)

@eleanorjboyd todo: adopt dev-requirements.txt as something we search in the python environment extension when finding dependency files.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits October 8, 2025 03:14
Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
- Add `*requirements*.txt` pattern to find requirements files at workspace root
- This ensures files like dev-requirements.txt, test-requirements.txt are found
- Add deduplication logic to handle overlapping search patterns
- All existing unit tests pass

Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
- Test finding dev-requirements.txt at workspace root
- Test deduplication of files found by multiple patterns
- Test finding files in subdirectories and requirements/ folders
- Test filtering files by project directories
- All 181 unit tests passing (5 new tests added)

Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
Copilot AI changed the title [WIP] Add support for dev-requirements.txt in environment dependencies Fix missing dev-requirements.txt in workspace dependencies list Oct 8, 2025
Copilot AI requested a review from eleanorjboyd October 8, 2025 03:30
Copilot finished work on behalf of eleanorjboyd October 8, 2025 03:30
@eleanorjboyd eleanorjboyd marked this pull request as ready for review October 8, 2025 03:56
@eleanorjboyd eleanorjboyd added the feature-request Request for new features or functionality label Oct 8, 2025
@eleanorjboyd eleanorjboyd added this to the October 2025 milestone Oct 8, 2025
@eleanorjboyd eleanorjboyd enabled auto-merge (squash) October 8, 2025 04:32
@eleanorjboyd eleanorjboyd merged commit 55b8efd into main Oct 8, 2025
11 checks passed
@eleanorjboyd eleanorjboyd deleted the copilot/add-dev-requirements-support branch October 8, 2025 06:31
NguyenCuong1989 referenced this pull request in NguyenCuong1989/vscode-python-environments Oct 23, 2025
Fixes microsoft/vscode-python-environments#506

Added an explicit glob pattern `*requirements*.txt` to ensure
requirements files at the workspace root are reliably found. The fix
includes:

1. **Additional search pattern**: Added
`findFiles('*requirements*.txt')` to explicitly search the workspace
root
2. **Deduplication logic**: Implemented deduplication using a Map keyed
by file system path to handle overlapping patterns
3. **Comprehensive tests**: Created 5 new unit tests to validate the fix

Now both patterns work together:
- `**/*requirements*.txt` - finds requirements files in subdirectories
- `*requirements*.txt` - finds requirements files at workspace root

## Requirements Files Now Discovered

This fix ensures all common requirements file naming patterns are found:
- `requirements.txt` - main dependencies
- `dev-requirements.txt` - development dependencies ✨
- `test-requirements.txt` - testing dependencies ✨
- `docs-requirements.txt` - documentation dependencies ✨
- `prod-requirements.txt` - production dependencies ✨
- Any other `*requirements*.txt` variant ✨

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> 
> ----
> 
> *This section details on the original issue you should resolve*
> 
> <issue_title>Missing requirements file in workspace dependencies
list</issue_title>
> <issue_description>I have the following file structure 
> 
>
![Image](https://github.com/user-attachments/assets/fccc626f-dedd-4c6e-8d66-93b7fc47ec6e)
> 
> - click + on venv in environments panel 
> - click to create environment in root directory
> - custom environment
> - install workspace dependencies
> - I only see `requirements.txt` as an option
> 
> I expect I would see both dev-requirements.txt and requirements.txt
because they are both present in the root folder
> 
> 
>
![Image](https://github.com/user-attachments/assets/0868fe35-f0c1-4b38-bf50-e40d7835a4f2)
> 
> </issue_description>
> 
> ## Comments on the Issue (you are @copilot in this section)
> 
> <comments>
> <comment_new><author>@eleanorjboyd</author><body>
> todo: adopt dev-requirements.txt as something we search in the python
environment extension when finding dependency
files.</body></comment_new>
> </comments>
> 


</details>

<!-- START COPILOT CODING AGENT TIPS -->
---

💡 You can make Copilot smarter by setting up custom instructions,
customizing its development environment and configuring Model Context
Protocol (MCP) servers. Learn more [Copilot coding agent
tips](https://gh.io/copilot-coding-agent-tips) in the docs.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: eleanorjboyd <26030610+eleanorjboyd@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature-request Request for new features or functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing requirements file in workspace dependencies list

3 participants